-- GENERATED SPELL FOR [Wrenix's Gizmotronic Apparatus] --


function spell0_7166(pUnit, Event) --6Conjure E.C.A.C,n/a--
pUnit:FullCastSpellOnTarget(9977,pUnit:GetMainTank ())
pUnit:RegisterEvent('Sorts_7166', 0, 1)
end

function spell1_7166(pUnit, Event) --@Red Firework,Self--
pUnit:FullCastSpellOnTarget(6668,pUnit)
pUnit:RegisterEvent('Sorts_7166', 535, 1)
end

function spell2_7166(pUnit, Event) --6Thieves\' Tool Rack Conjure,n/a--
pUnit:FullCastSpellOnTarget(9949,pUnit:GetMainTank ())
pUnit:RegisterEvent('Sorts_7166', 0, 1)
end

function Sorts_7166(pUnit, Event)
local choix_sorts_7166 = math.random(0, 2)
if choix_sorts_7166 == 0 then
pUnit:RegisterEvent('spell0_7166', 1, 1)
end
if choix_sorts_7166 == 1 then
pUnit:RegisterEvent('spell1_7166', 1, 1)
end
if choix_sorts_7166 == 2 then
pUnit:RegisterEvent('spell2_7166', 1, 1)
end
end

function mob7166_Action(pUnit, Event)
pUnit:RegisterEvent('Sorts_7166', math.random(1500, 3000), 1)
end

function mob7166_Leave(pUnit, Event)
--pUnit:RemoveEvents();--
end

function mob7166_Kill(pUnit, Event)
--pUnit:RemoveEvents();--
end

function mob7166_Die(pUnit, Event)
pUnit:RemoveEvents();
end

RegisterUnitEvent(7166, 1, 'mob7166_Action')
RegisterUnitEvent(7166, 2, 'mob7166_Leave')
RegisterUnitEvent(7166, 3, 'mob7166_Kill')
RegisterUnitEvent(7166, 4, 'mob7166_Die')
